#ifndef ANIMATION_UNIT_H
#define ANIMATION_UNIT_H
#include "Unit.h"

enum
{
	AVTAR_BODY,
	AVTAR_MAX,
};



extern const char *GDefaultAnimation;

class AnimationUnit : public Unit
{
public:
	AnimationUnit();
	virtual ~AnimationUnit();

	CREATE_FUNC(AnimationUnit);
	bool init();

	void changeAvtar(int type,const char* name);
	void play(const char* animationName,bool loop=false);
	void finish();

	cocos2d::CCAnimation* loadAnimation(const char* meshAnimationName);
	cocos2d::CCAnimation* getAnimation(const char* meshAnimationName);

protected:
	bool			mAutoIdle;
	std::string		mCurAnimation;
	cocos2d::CCSprite*	mAvtars[AVTAR_MAX];
	std::string	mEquipItem[AVTAR_MAX];
};

#endif